<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputLabel value="#{bundle.ListPartofspeechTitle}"></h:outputLabel>
        </ui:define>
        <ui:define name="body">
            <h:form styleClass="jsfcrud_list_form">
<!--                <h:panelGroup id="messagePanel" layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                </h:panelGroup>-->
                <h:outputLabel escape="false" value="#{bundle.ListPartofspeechEmpty}" rendered="#{partofspeechController.items.rowCount == 0}"/>
                <h:panelGroup rendered="#{partofspeechController.items.rowCount > 0}">
                    <h:outputLabel value="#{partofspeechController.pagination.pageFirstItem + 1}..#{partofspeechController.pagination.pageLastItem + 1}/#{partofspeechController.pagination.itemsCount}"/>&nbsp;
                    <h:commandLink  id="link1" action="#{partofspeechController.previous}" value="#{bundle.Previous} #{partofspeechController.pagination.pageSize}" rendered="#{partofspeechController.pagination.hasPreviousPage}"/>&nbsp;
                    <h:commandLink  id="link2" action="#{partofspeechController.next}" value="#{bundle.Next} #{partofspeechController.pagination.pageSize}" rendered="#{partofspeechController.pagination.hasNextPage}"/>&nbsp;
                    <h:dataTable value="#{partofspeechController.items}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" columnClasses="editRemoveview">
                        <h:column>
                            <f:facet name="header">
                                <h:outputLabel value="&nbsp;"/>
                            </f:facet>
                            <h:commandLink id="link3"  action="#{partofspeechController.prepareView}" value="#{bundle.ListPartofspeechViewLink}"/>
                            <h:outputLabel value=" "/>
                            <h:commandLink  id="link4" action="#{partofspeechController.prepareEdit}" value="#{bundle.ListPartofspeechEditLink}"/>
                            <c:if test="#{roleinfoControllerA.isAdmin(teacherAdminController.logined)}">
                                <h:outputLabel value=" "/>
                                <h:commandLink  id="link5" action="#{partofspeechController.destroy}" value="#{bundle.ListPartofspeechDestroyLink}"
                        </c:if>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputLabel value="#{bundle.ListPartofspeechTitle_id}"/>
                        </f:facet>
                        <h:outputLabel value="#{item.id}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputLabel value="#{bundle.ListPartofspeechTitle_name}"/>
                        </f:facet>
                        <h:outputLabel value="#{item.name}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputLabel value="#{bundle.ListPartofspeechTitle_chinese}"/>
                        </f:facet>
                        <h:outputLabel value="#{item.chinese}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputLabel value="#{bundle.ListPartofspeechTitle_memo}"/>
                        </f:facet>
                        <h:outputLabel value="#{item.memo}"/>
                    </h:column>

                </h:dataTable>
            </h:panelGroup>
            <br />
            <h:commandLink  id="link5" action="#{partofspeechController.prepareCreate()}" value="#{bundle.ListPartofspeechCreateLink}"/>
            <br />
            <br />
            <h:link id="link6"  outcome="/index" value="#{bundle.ListPartofspeechIndexLink}"/>
        </h:form>
    </ui:define>
</ui:composition>

</html>
